<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/danmu', function() {
    return view('danmu');
});

Route::get('/', 'PagesController@root')->name('root');
Route::get('/task/test',function (){
    $task = new \App\Jobs\TestTask("测试异步任务");
    $res = \Hhxsv5\LaravelS\Swoole\Task\Task::deliver($task);
    var_dump($res);
});

Auth::routes();

Route::group(['middleware' => 'auth'],function (){
    Route::group(['middleware' => 'email_verified'],function (){
        Route::get('user_addresses','UserAddressesController@index')->name('user_addresses.index');
        Route::get('user_addresses/create','UserAddressesController@create')->name('user_addresses.create_and_edit');
    });
    Route::get('/email_verify_notice', 'PagesController@emailVerifyNotice')->name('email_verify_notice');
    Route::get('/email_verification/verify', 'EmailVerificationController@verify')->name('email_verification.verify');
    Route::get('/email_verification/send', 'EmailVerificationController@send')->name('email_verification.send');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
